package com.woniu.message.listener;

import org.springframework.amqp.core.*;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class RabbitConfig {
    @Bean
    public Queue paymentQueue() {
        return new Queue("paymentQueue");
    }
    @Bean
    public Exchange paymentExchange() {
        return new DirectExchange("paymentExchange");
    }
    @Bean
    public Binding paymentBinding() {
        return BindingBuilder.bind(paymentQueue()).to(paymentExchange()).with("payment.key").noargs();
    }
}
